import ActionGroup from "./ActionGroup.vue"
/**
 * tooltip {boolean}  
 */
const columns = (showOperate, selectClassification) => {
  let arr = [
    // {
    //   type: 'selection',
    //   width: 55
    // },
    {
      label: 'Organization Code',
      prop: 'code',
      width: 150,
      tooltip: false,
    },
    {
      label: 'Classification',
      prop: 'classification',
      width: 120,
      tooltip: false,
      formatter: (row, column, cellValue, index) => {
        let item = selectClassification?.find(i => i.value == row.type) || ''
        return item?.label || ''
      }
    },
    {
      label: 'Organization Name',
      prop: 'name',
      width: 180,
      tooltip: true,
    },
    {
      label: 'City',
      prop: 'cityName',
      width: 120,
      tooltip: true,
    },
    {
      label: 'Area',
      prop: 'area',
      width: 120,
      tooltip: true,
    },
    {
      label: 'Lng',
      prop: 'lng',
      width: 120,
      tooltip: true,
      formatter: (row, column, cellValue, index) => {
        return row.lng
      }
    },
    {
      label: 'Lat',
      prop: 'lat',
      width: 120,
      tooltip: true,
      formatter: (row, column, cellValue, index) => {
        return row.lat
      }
    },
    {
      label: 'Manager',
      prop: 'manager',
      width: 120,
      tooltip: false,
    },
    {
      label: 'Telephone',
      prop: 'telephone',
      width: 120,
      tooltip: false,
    },
    {
      label: 'Address',
      prop: 'address',
      minWidth: 160,
      tooltip: true,
    },
    {
      label: 'Category',
      prop: 'categoryName',
      width: 130,
      tooltip: false
    },
    {
      label: 'Scale',
      prop: 'scaleName',
      width: 130,
      tooltip: false,
    },
  ];
  if (showOperate) {
    arr.push({
      label: "Operate",
      width: 240,
      render: ActionGroup
    })
  }
  return arr;
}

export default columns;